# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2 do
  @moduledoc """


  ## Attributes

  *   `data` (*type:* `String.t`, *default:* `nil`) - Image data base64 encoded.
  *   `height` (*type:* `integer()`, *default:* `nil`) - Height of screenshot in pixels.
  *   `key` (*type:* `String.t`, *default:* `nil`) - Unique string key, if any, identifying this image.
  *   `mime_type` (*type:* `String.t`, *default:* `nil`) - Mime type of image data (e.g. "image/jpeg").
  *   `page_rect` (*type:* `GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2PageRect.t`, *default:* `nil`) - The region of the page that is captured by this image, with dimensions measured in CSS pixels.
  *   `width` (*type:* `integer()`, *default:* `nil`) - Width of screenshot in pixels.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :data => String.t(),
          :height => integer(),
          :key => String.t(),
          :mime_type => String.t(),
          :page_rect => GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2PageRect.t(),
          :width => integer()
        }

  field(:data)
  field(:height)
  field(:key)
  field(:mime_type)
  field(:page_rect, as: GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2PageRect)
  field(:width)
end

defimpl Poison.Decoder, for: GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2 do
  def decode(value, options) do
    GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PageSpeedOnline.V2.Model.PagespeedApiImageV2 do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
